<template>
	<view class="wf-box">
		<HeadNav titleName="添加代币" :navBarHeight="navBarHeight"></HeadNav>
		
		<view class="main" :style="{ paddingTop: navBarHeight }">
			<view class="pd-box">
				<view class="search">
					<image src="../../static/img/search.png"></image>
					<input type="text" placeholder="搜索币名或者合约">
				</view>
				
				<view class="topic">
					<view class="topic-main">
						<view class="topic-im " :class="curTitle == 1 ? 'cur-im' : ''" @click="selectTitle(1)">
							<view class="topic-im-text">
								热门代币
							</view>
								
						</view>
						<view class="topic-im" :class="curTitle == 2 ? 'cur-im' : ''" @click="selectTitle(2)">
							<view class="topic-im-text">
								自定义代币
							</view>
								
						</view>
					</view>
					
				</view>
				
				
				<view class="network-scroll">
					<scroll-view scroll-y="true" class="scroll-Y" >
						<view class="scroll-view-item" v-for="item in coinList" @click="selectCoin(item)">
							<image src="../../static/img/demo-03.png" class="coin-img"></image>
							<!-- <text>{{ item.text }}</text> -->
							<view class="coin-info">
								<view class="coin-name">KT<text>(KT)</text></view>
								<view class="coin-address">0x9485BA...c92D7656</view>
							</view>
							<view class="status">
								<image src="../../static/img/chat-08.png" v-if="curId != item.id"></image>
								<image src="../../static/img/chat-07.png" v-else></image>
							</view>
						
						</view>
					</scroll-view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import HeadNav from "@/components/HeadNav"
	import navBarMixin from '@/mixin/navBarMixin.js'
	export default {
		data() {
			return {
				curTitle: 1,
				curId: 1,
				coinList: [{
					id: 1,
					text: 'Binance(BSC)'
				}, {
					id: 2,
					text: 'Ethereum'
				}, {
					id: 3,
					text: 'Avalanche'
				}],
			}
		},
		components: {
			HeadNav
		},
		mixins: [navBarMixin],
		methods: {
			back() {
				uni.navigateBack()
			},
			selectTitle(e) {
				this.curTitle = e
			},
			selectCoin(cut) {
				const { id, text } = cut
				this.curId = id
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wf-box {
		padding-bottom: 60rpx;
		overflow: hidden;
		
		.main {
			margin-top: 126rpx;
			padding: 0 30rpx;
			// padding-bottom: 80rpx;
			box-sizing: border-box;
			.pd-box {
				padding: 30rpx 0;
				// min-height: 1300rpx;
				background: #fff;
				border-radius: 10rpx;
				.search {
					margin: 0 30rpx;
					padding: 0 30rpx;
					height: 76rpx;
					background: #F4F4F4;
					display: flex;
					align-items: center;
					border-radius: 40rpx;
					image {
						width: 48rpx;
						height: 48rpx;
					}
					input {
						margin-left: 20rpx;
					}
				}
				
				.topic {
					margin-top: 14rpx;
					border-bottom: 2rpx solid #eee;
					.topic-main {
						display: flex;
						padding: 0 30rpx;
						.topic-im {
							padding: 0 30rpx;
							height: 80rpx;
							line-height: 80rpx;
							color: #999;
							&:first-child {
								padding-left: 0;
							}
							.topic-im-text {
								// border-bottom: 2rpx solid $theme-color-a;
							}
							&.cur-im {
								color: #333;
								.topic-im-text {
									border-bottom: 2rpx solid $theme-color-a;
								}
								
							}
						}
					}
					
				}
				
				.network-scroll {
					min-height: 882rpx;
					padding: 0 30rpx;
				
					.scroll-Y {
						height: 882rpx;
						overflow: hidden;
					}
				
					.scroll-view-item {
						height: 126rpx;
						display: flex;
						align-items: center;
						border-bottom: 2rpx solid #eee;
				
						.coin-img {
							width: 56rpx;
							height: 56rpx;
						}
						
						.coin-info {
							margin-left: 10rpx;
							.coin-name {
								text {
									color: #999;
								}
							}
							.coin-address {
								font-size: 22rpx;
								color: #999999;
							}
						}
				
						.status {
							margin-left: auto;
				
							image {
								width: 30rpx;
								height: 30rpx;
							}
						}
					}
				}
				
				.foot-pd {
					padding: 0 20rpx;
					margin-top: 100rpx;
					view {
						line-height: 80rpx;
						border-radius: 40rpx;
						text-align: center;
						color: #fff;
						background: $theme-color-a;
					}
				}
			}
		}
	}
</style>